#pragma once

#include <iostream>
#include <string>
#include <ctime>

#define NORMAL 1  // 正常
#define WARNING 2 // 警告
#define DEBUG 3   // 调试
#define FATAL 4   // 致命

//#LEVEL中的#作用是将LEVEL宏展开为字符串
#define LOG(LEVEL,MESSAGE) log(#LEVEL,MESSAGE,__FILE__,__LINE__)

void log(std::string level, std::string message, std::string file, int line)
{
    std::cout << "[" << level << "]" << "[" << time(nullptr) << "]" << "[" << message << ']' << "[" << file << ":" << line << "]" << std::endl;
}